<style>
    .permission-cnt{
        padding-left: 10px;
        padding-right: 10px;
    }
    .permission-cnt label{
        font-weight: normal;
        font-size: 12px;
        margin-right: 10px;
    }
    .permission-cnt h5{
        font-weight: bold;
    }
    .permission-group{
        display: flex;
        align-items: center;
    } 
</style>
<template>
    <div class="permission-cnt" style="padding-left: 20px;">
        <h5>附件相关</h5>
        <div class="permission-group">
            <label >
                <input type="radio" v-model="data.file" value="allow" name="file">
                允许上传附件
            </label>
            <label>
                <input type="radio" v-model="data.file" value="disallow" name="file">
                禁止上传附件
            </label>
            <label >
                <input type="radio" v-model="data.file" value="force" name="file">
                强制上传附件
            </label>
        </div>
        <div class="checkbox" style="display: none">
            <label>
                <input name="permission" type="checkbox" value="allowDownload" v-model="data.permission">
                允许下载附件
            </label>
        </div>
        <div style="height: 20px;"></div>
        <div class="checkbox" style="">
            <label>
                <input name="permission" type="checkbox" value="allowBack" v-model="data.permission">
                允许回退
            </label>
            <label>
                <input name="permission" type="checkbox" value="retreat" v-model="data.permission">
                允许回撤
            </label>
        </div>
        <div class="checkbox" style="display: none">
            <label>
                <input name="permission" type="checkbox" value="departmentFirst" v-model="data.permission">
                只保留部门相关人员
            </label>
        </div>
    </div>
</template>

<script>
    var component = {
        props:["data"],
        data(){
           return {}
        },
        created(){
            this.data = this.data || {}
            this.data.permission = this.data.permission || [];
            this.data.file = this.data.file || "disallow"
        }
    }
    // var nodeId = location.search.match(/id=([^&]+)/)[1]
    // opener.bpmData.nodes[nodeId].data = opener.bpmData.nodes[nodeId].data || [];
    // $("input[name='permission']").on('click',function(){
    //     var arr_v = new Array();
    //     $('input[name="permission"]:checked').each(function(){
    //         // opener.bpmData.nodes[nodeId].allowUpload = true;
    //         arr_v.push($(this).val());
    //     });
    //     opener.bpmData.nodes[nodeId].data = arr_v;
    //
    // })
    //
    // $.each(opener.bpmData.nodes[nodeId].data,function(i,item){
    //     $("input[name='permission'][value="+item+"]").attr("checked","checked");
    //
    // });
</script>
